﻿Namespace Entities

    ''' <summary>
    ''' Defines user stats timerange string for user stats timerange
    ''' </summary>
    ''' <remarks></remarks>
    <Serializable()>
    Public NotInheritable Class UserStatsDatePeriods
        Private Sub New()

        End Sub


        Public Shared Function GetString(period As Entities.UserStatsDatePeriod?) As String
            If period.HasValue Then
                Select Case period.Value
                    Case Entities.UserStatsDatePeriod.OneDay
                        Return UserStatsDatePeriods.OneDay
                    Case Entities.UserStatsDatePeriod.OneMonth
                        Return UserStatsDatePeriods.OneMonth
                    Case Entities.UserStatsDatePeriod.OneWeek
                        Return UserStatsDatePeriods.OneWeek
                    Case Entities.UserStatsDatePeriod.ThreeDays
                        Return UserStatsDatePeriods.ThreeDays
                    Case Entities.UserStatsDatePeriod.Today
                        Return UserStatsDatePeriods.Today
                    Case Entities.UserStatsDatePeriod.TwoDays
                        Return UserStatsDatePeriods.TwoDays
                    Case Entities.UserStatsDatePeriod.Yesterday
                        Return UserStatsDatePeriods.Yesterday
                    Case Else
                        Return UserStatsDatePeriods.All
                End Select
            Else
                Return String.Empty
            End If
        End Function


        Public Shared ReadOnly Property All As String
            Get
                Return "all"
            End Get
        End Property

        Public Shared ReadOnly Property Today As String
            Get
                Return "today"
            End Get
        End Property

        Public Shared ReadOnly Property Yesterday As String
            Get
                Return "yesterday"
            End Get
        End Property

        Public Shared ReadOnly Property OneDay As String
            Get
                Return "one_day"
            End Get
        End Property

        Public Shared ReadOnly Property TwoDays As String
            Get
                Return "two_days"
            End Get
        End Property

        Public Shared ReadOnly Property OneMonth As String
            Get
                Return "one_month"
            End Get
        End Property

        Public Shared ReadOnly Property OneWeek As String
            Get
                Return "one_week"
            End Get
        End Property

        Public Shared ReadOnly Property ThreeDays As String
            Get
                Return "three_days"
            End Get
        End Property
    End Class

End Namespace

